package vip.specimen.system.datasource.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.List;

/**
 * *@Author: 余浪人
 * *@Date：2021/3/10 14:33
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Getter
@Setter
@Entity
@Table(name = "system_resource_kind")
public class SystemResourceKindEntity extends BaseEntity {
    @ApiModelProperty(value = "分类名称")
    private String name;
    @Column(length = 1024)
    @ApiModelProperty(value = "分类简介")
    private String intro;//简介
    @ApiModelProperty(value = "所含后缀", dataType = "List")
    @OneToMany(targetEntity = SystemResourceSuffixEntity.class, fetch = FetchType.EAGER)
    @JoinTable(name = "system_kind_suffix", joinColumns = @JoinColumn(name = "system_kind_uuid"), inverseJoinColumns = @JoinColumn(name = "system_suffix_uuid"))
    private List<SystemResourceSuffixEntity> suffix;
    @ApiModelProperty(value = "状态", dataType = "boolean")
    private boolean enable = Boolean.FALSE;
    @ApiModelProperty(value = "存储路径")
    private String path;

    public SystemResourceKindEntity() {
    }

    public SystemResourceKindEntity(String name, String intro, List<SystemResourceSuffixEntity> suffix, boolean enable, String path) {
        this.name = name;
        this.intro = intro;
        this.suffix = suffix;
        this.enable = enable;
        this.path = path;
    }
}
